<?

require("config.php");
$langname = 'learning_zone';


if ($act){

$query = "select firstname, lastname, username, password from cus_basic where email = '$Email' ";

$r = myQuery($query);

if (!$r) {

	$s = $lang['forget_email_not_exist'];

}else{

	$Username = $r[0][2];
	$Password = $r[0][3];

	$from_name = $lang['email_from_name'];
	$from_email = $lang['email_from_email'];

	$to_name = $r[0][0] . " " . $r[0][1];

	$to_email = $Email;

	$subject = $lang['forget_subject_c'];


$file = "alert_retrieved_password.php?";

$target = 
"Email=" . urlencode($Email) .
"&Name=" . urlencode($to_name) .
"&Username=" . urlencode($Username) .
"&Password=" . urlencode($Password);

$content =  file($DIR_URL . 'email/' . $file . $target);
for ($n=0;$n<count($content);$n++){
	$content1 .= $content[$n];
}

//for ($i=0;$i<count($content);$i++){print $content[$i];}
sendhtmlmail($from_name,$from_email,$to_name,$to_email,$subject,$content1);

header("location:forget1.php?Email= ". urlencode($Email) . "&Username=" . urlencode($Username));
}

}

require($rela_path . "header.php");
?>










<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <!--<td width="17"><img src="../images/shim.gif" width="17" height="1"></td>-->
    <td width="186" valign="top"> 
      <?require("../nav.php")?>
    </td>
    <td width="11"><img src="../images/shim.gif" width="11" height="1"></td>
    <td valign="top"> 
      <?require("../menu.php")?>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td align="right"><table width="100%" border="0">
              <tr> 
                <td height="50" class="header">&gt;&gt; <?=$lang['retrieve_password']?></td>
              </tr>
            </table></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td valign="top"><p><br>
              <br>
              
<script language="JavaScript"> 
<!-- 
function checkForm(theform) { 


if (validate_email(theform.Email.value)== false){ 
    theform.Email.focus(); 
    alert("<?=$lang['invalid_email']?>"); 
    return false; } 
}
//--> 
</script>


            <form name="form1" method="post" action="forget.php" onSubmit="return checkForm(this)">
              <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr> 
                  <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr> 
                        <td width="13"><img src="../images/c1.gif" width="13" height="37"></td>
                        <td background="../images/c5.gif" class="boxTitle"><?=$lang['retrieve_password']?></td>
                        <td width="13"><img src="../images/c2.gif" width="13" height="37"></td>
                      </tr>
                    </table></td>
                </tr>
                <tr> 
                  <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td width="2" bgcolor="B1CAE8"><img src="../images/shim.gif" width="2" height="1"></td>
                        <td align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr> 
                              <td bgcolor="F78D83"><img src="../images/shim.gif" width="1" height="2"></td>
                            </tr>
                          </table>
                          <table width="96%" border="0" align="center">
                            <tr>
                              <td>&nbsp;</td>
                            </tr>
                            <tr> 
                              <td><?=$lang['retrieve_password_msg']?>
								
								<font color="#FF0000"><?=$s?></font>
								
								</td>
                            </tr>
                          </table>
                          <table width="96%" border="0" align="center">
                            <tr>
                              <td>&nbsp;</td>
                              <td>&nbsp;</td>
                            </tr>
                            <tr> 
                              <td><?=$lang['enter_email_addr']?> : </td>
                              <td> <input name="Email" type="text" class="text" size="30"> 
							  <input name="act" type="hidden" class="text" size="30" value="send">
                              </td>
                            </tr>
                            <tr> 
                              <td>&nbsp;</td>
                              <td><br> <input type="submit" name="Submit" value=" continue " class="button"></td>
                            </tr>
                            <tr> 
                              <td>&nbsp;</td>
                              <td>&nbsp;</td>
                            </tr>
                          </table>
                        </td>
                        <td width="2" bgcolor="B1CAE8"><img src="../images/shim.gif" width="2" height="1"></td>
                      </tr>
                    </table></td>
                </tr>
                <tr> 
                  <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr> 
                        <td width="6"><img src="../images/c3.gif" width="6" height="6"></td>
                        <td background="../images/c7.gif"><img src="../images/c7.gif" width="6" height="6"></td>
                        <td width="6"><img src="../images/c4.gif" width="6" height="6"></td>
                      </tr>
                    </table></td>
                </tr>
              </table>
              </form></td>
        </tr>
        <tr> 
          <td>&nbsp;</td>
        </tr>
        <tr> 
          <td height="117" valign="top"><br> <br> <br> </td>
        </tr>
      </table>
      <br>
      <br> </td>
    <td width="11"><img src="../images/shim.gif" width="11" height="1"></td>
    <td width="173" valign="top">
	
	
<?require("../list.php")?>	 
	  
	  
    </td>
    <!--<td width="17"><img src="../images/shim.gif" width="17" height="1"></td>-->
  </tr>
</table>





<?require("../footer.php")?>	